package com.cuit.dashboard.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cuit.dashboard.common.util.Result;
import com.cuit.dashboard.system.entity.SysAdminTokenEntity;

/**
 * @program: zuke
 * @description: 登录
 * @author: KamTang
 * @create: 2022-04-01 19:40
 **/
public interface SysAdminTokenService extends IService<SysAdminTokenEntity> {

    /**
     * 获取token
     * @param userId
     * @return Result
     */
    Result createToken(long userId);

    /**
     * 根据令牌获取令牌——验证数据库中是否存在该令牌
     * @param token 令牌
     * @return token
     */
    SysAdminTokenEntity queryByToken(String token);

    /**
     * 退出
     * @param id id
     */
    void logout (long id);
}
